RE: Where to paste the code?

3 views
Skip to first unread message

JayABee

unread,
Jul 31, 2010, 12:07:12 PM7/31/10
to SWFObject
Hi

Please excuse me but I am a complete amateur to Javascript. I do want
to learn how to code it eventually, but for now I am on this.

So apparently swfobject is a cool gizmo for adding flash to a Web page
using JavaScript.

I have a flash movie file prepared , it was originally saved with
a .fla extension, but I am not sure whether I should change this to
a .swf extension ?

So using MS Expression Web 2.0 software i inserted my flash movie file
to my page and I have copied the swfobject code found at the following
link: http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js
to within the <head> section of that page and surrounded it with
<script = text/javascript> and </script> tags.

Well the flash movie doesn't play as I expected to. I have tested
this using the same file with .fla extension and a .swf extension,
neither worked.

Please may I have a pointer on where I am going wrong.

Thanks In Advance for help much appreciated

Kind Regards
JayABee

Sam Sherlock

unread,
Jul 31, 2010, 6:42:07 PM7/31/10
to swfo...@googlegroups.com
have you tried the online generator?
http://www.bobbyvandersluis.com/swfobject/generator/index.html

have you got a link so others can point out your errors

in the mean time there is a great deal of information on the swfobject wiki - but being a noob this may not be to your taste.


----


I would compare your current markup with that created by the generation  tool (first link)

swf or ShockWave Flash are the end results of exporting FLAsh projects.  You don't change it but export the fla document to a swf (flash IDE can output to other formats too)

you want the following in the <head> of you html document before it closes is a ideal 

<!-- for a script tag that SouRCe's an external javascript file - then calls to setup you desired swfobject(s)-->
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" type="text/javascript"></script>
<script type="text/javascript">

// what goes here depends on the type of swfobject you using in the page - see links 2 & 3 for to scoop on this

</script>

--

post back if you have any further questions. links would be helpful if you can or at least some sample code 

with an explanation of what your hoping to achieve

hth  - S





--
You received this message because you are subscribed to the Google Groups "SWFObject" group.
To post to this group, send email to swfo...@googlegroups.com.
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.


JayABee

unread,
Aug 8, 2010, 3:38:59 PM8/8/10
to SWFObject
Oh Thanks Sam
That was some really good advice there.

I used the code generator that you suggested and followed your advice
about the script tags in the head section. It still didn't work
though.
I have uploaded my attempt at the following link:
www.jenniferbeecroft.com/test_flash_page.html

If you view the source you will see because the code I have used
doesn't actually appear to show any content on the page.
Also sorry that the code is a bit wierd, it looks like Bravenet (the
hosting site) add their own head and body section to make sure their
ads are included, so the source code may appear a bit confusing at
first. Hopefully you will be able to work out what is my code.

I have uploaded the .fla file to the host server too. The file is one
of the saved templates that came with Adobe Flash CS3 Professional.
It works when I run it in that program.

I'll check out the tutorial links that Sam suggested but in the
meantime if anyone can help now that I have uploaded an example
beforeI manage to figure it out, that would be great.

As for what I am trying to acheive ... For now it is literally just a
test. I want to learn how to embed flash into a page now, in case I
ever need to do it in the future.
I am thinking of offering my web design skills to others you see which
is why, as I said before, I would like to learn Javascript next.

Thanks
JayABee

Sam Sherlock

unread,
Aug 9, 2010, 5:16:29 AM8/9/10
to swfo...@googlegroups.com
just had a  brief look

2 things I notice right off


  1. the source for swfobject.js is incorrect maybe Maybe use the google hosted api if this still stumbles you
  2. the html source is not valid - bot sure if this is due to auto-placed adds - but if you look you see 2 titles (really its 2 docs in one)
correct those points and it should work then

I have uploaded the .fla file to the host server too

you don't need to its not used - its large in file size its not used by the swf once on the server

think PSD which are photoshop native files and from these you can EXPORT JPG or PNG
with FLA which are flash native files you EXPORT SWF

You may have to work around BRAVENET altering you markup (this would irk me)

 - S



JayABee

JayABee

unread,
Aug 18, 2010, 4:28:26 PM8/18/10
to SWFObject
Hello Again

Thanks for your help. I have done my best again - also using the
'learn the baics' link that you gave in your previous post, for extra
help.

1. I wasn't sure what you meant by: 'the source is incorrect' . I
have used the Google hosted API link as the source in my next
example. What's wrong now?!
2. I don't think there's anything I could have done about the two
documents in one, that was down to Bravenet hosts.

I have now uploaded the code to my non Bravenet hosted domain - the
code there is all my own.
You can view my latest attempt at: www.beecroftprecision.com/test_flash_page.html

Needless to say............. Still no luck for little JayABee

Thx
J

JayABee

unread,
Aug 18, 2010, 4:30:54 PM8/18/10
to SWFObject
Hi

Clicking on the link I just posted doesn't seem to work. Copy and
paste the link to the address bar though and it will load the page.

Thx
J

Aran Rhee

unread,
Aug 18, 2010, 5:39:54 PM8/18/10
to swfo...@googlegroups.com
So currently it is looking for :


and not finding the file. Have you uploaded this file to your server?

also, you need to place expressinstall.swf somewhere on your server and point to its correct location within the call:

swfobject.registerObject("flashcontent", "9", "/path/to/expressinstall.swf");   


Aran



Thx
J

JayABee

unread,
Aug 25, 2010, 4:36:55 PM8/25/10
to SWFObject
Hi Aran

Those are all interesting points. Thanks for your help. ok so I have
expressinstall.swf on my desktop now in a zip file. Just waiting to
unzip it and then I will give it a whirl and report back.

Ta
Jen

JayABee

unread,
Aug 30, 2010, 11:17:35 AM8/30/10
to SWFObject
Hi Aran

Well from the beginning Sam Sherlock suggested that I only needed to
name the file 'test_quiz.fla' and I did not need to change the
extension to swf . (as I understood it?!?)
Then also from reading one of his later posts, it seemed to suggest
that I did not need to upload the flash file to the server anway. I
did think that ws a bit strange.

Annyway this time I have uploaded 'expressinstall.swf' as you
suggested to the server and pointed to its location within the code.
the file that I have uploaded is ' test_quiz.fla ' , but I also tried
renaming it 'test_quiz.swf' , and it didn't work either.

I found an example of swf on the web,
The URL is: http://azureliving.com/azureflash2010.swf
and this was the code:
<html><body leftmargin=0 topmargin=0 scroll=no> <embed width=100%
height=100% fullscreen=yes src="http://azureliving.com/
azureFlash2010.swf"></body></html>g

so going by the example given above I tried to rename my page: '
test_flash_page.swf ' instead of the html extension that I have been
using. Needless to say that was worse than useless lol . I am
guessing the above example does not embed the flash but just uses the
file outright.

So here is my link: www.beecroftprecision.com/test_flash_page.html
I hope somebody out there can help me finally get to the bottom of it
- so that I can see swfobject code working .....

Many Thanks
JayABee :-)

JayABee

unread,
Aug 30, 2010, 11:29:22 AM8/30/10
to SWFObject
Hi All
sorry for the link in my previous message not working again. Try this
one: http://www.beecroftprecision.com/test_flash_page.html
If not we will have to go with the copy /paste to the address bar
again.

Tanks Guys.........

Aran Rhee

unread,
Aug 30, 2010, 12:10:27 PM8/30/10
to swfo...@googlegroups.com
Hi Jennifer

If you re-read Sam's comments about FLA's and SWF's he says that a SWF is the resultant file from exporting from a FLA. You don't rename the FLA in order to place it on your site. You need to run the "publish" command from within your Flash IDE.

I am a bit worried at the potential learning curve you might be doing here if you don't understand the difference between these two files, or that you have to place the files you are wanting to show people onto a server... Is there a friend who knows a bit about web development that you can ask to help explain a few things to you?


This is really the last email I can write on this thread. Hopefully you can follow these instructions:

1) export your test_quiz.swf from the Flash IDE
2) upload test_quiz.swf and expressinstall.swf onto your desired folder on your server
3) use the swfobject code generator. Put in these values:

SWFObject (.js): 

Adobe Express Install:
(+select checkbox) expressInstall.swf

Flash (.swf):
test_quiz.swf (or whatever is your actault .swf file name you exported from Flash, and uploaded to the server)



You will end up with an HTML file which looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("flashcontent", "9.0.0", "expressInstall.swf");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="200" height="200" id="flashcontent">
<param name="movie" value="test_quiz.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="test_quiz.swf" width="200" height="200">
<!--<![endif]-->
alt content goes here
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>


4) Upload this html file into the same folder you placed your other two files in.

That's it.

Aran




JayABee

unread,
Aug 30, 2010, 5:05:09 PM8/30/10
to SWFObject
Hey Thanks to Aran and Sam

:-)

Of course you know it's working - you practically did the code for me
(blush!)
Aran Of course it is a learning curve. Let this be the beginning of
me learning Javascript properley :-/ .

Sorry I took a side door in, that's just my personality - I got a be
in bonnet which was called swfobject - I had to conquer that before
anything else ;-) .

But I do really appreciate your help both of you!

Jen
:-D

Aran Rhee

unread,
Aug 30, 2010, 5:44:02 PM8/30/10
to swfo...@googlegroups.com
I am really glad it is working for you.

I remember when I was just learning too (although that was MANY years ago). The only reason I suggested to go ask a friend is that it is a way more effcient method of learning if you can ask a bunch of questions in person and actually get a proper understanding of something.

As moderating the lists here is just a volunteer position, there is only so much time that anyone can put into someone's issues.

Anyhow, go well.


Cheers,
Aran


--
Reply all
Reply to author
Forward
0 new messages